﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DBtest
{
    public partial class Form1 : Form
    {
        private SQLiteDB db = new SQLiteDB();
        public Form1()
        {
            InitializeComponent();
            db.DBFile = "recipts.db";
            db.SQLCommand("CREATE TABLE IF NOT EXISTS test (number INT PRIMARY KEY, date TEXT);");
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            db.SQLQuery("SELECT * FROM test;");
            dataGridView1.DataSource = db.QueryResult;
            dataGridView1.Invalidate();
        }
    }
}
